package com.wzcl.app.model.dto;

import com.alibaba.fastjson.annotation.JSONField;
import com.wzcl.app.dao.model.Commodity;
import com.wzcl.app.dao.model.Grade;
import com.wzcl.app.dao.model.Subject;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import javax.persistence.*;
import java.util.Date;

/**
 * @author beingven
 * @Description TODO
 * @createTime 2020年11月26日 10:11:00
 */
@Data
public class PayCourseDto {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @JSONField(serialize = false)
    @ManyToOne
    @JoinColumn(name = "subjectId")
    @ApiModelProperty(value = "科目")
    private Subject subject;

    @JSONField(serialize = false)
    @ManyToOne
    @JoinColumn(name = "gradeId")
    @ApiModelProperty(name = "年级")
    private Grade grade;

    @ApiModelProperty(value = "名称")
    private String name;

    @ApiModelProperty(value = "描述")
    private String description;

    @ApiModelProperty(value = "难度")
    private Integer hard;

    @ApiModelProperty(value = "创建时间")
    @CreatedDate
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    @LastModifiedDate
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    @ApiModelProperty(value = "是否含有资料")
    private Boolean haveBook;

    @ApiModelProperty(value = "课程状态")
    private Integer courseState;

    @ApiModelProperty(value = "课时数")
    private Integer count;

    @ApiModelProperty(value = "课程类型")
    private Integer courseType;

    @ApiModelProperty(value = "开始课程时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date startDate;

    @ApiModelProperty(value = "结束课程时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date endDate;

    @ApiModelProperty(value = "每天开始时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;

    @ApiModelProperty(value = "每天结束时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;

    @ApiModelProperty(value = "开始时间的前缀")
    private String timePrefix;

    @ApiModelProperty(value = "状态")
    private Integer state;

    @ApiModelProperty(value = "课程图片")
    private String pictures;

    @ApiModelProperty(value = "海报")
    @Column(columnDefinition = "TEXT")
    private String posters;

    @ApiModelProperty(value = "虚拟观看数")
    private Integer viewVolume;

    @ApiModelProperty(value = "实际观看数")
    private Integer realViewVolume;

    @ApiModelProperty(value = "虚拟销售数")
    private Integer saleVolume;

    @ApiModelProperty(value = "实际销售数")
    private Integer realSaleVolume;

    @JSONField(serialize = false)
    @ManyToOne(fetch = FetchType.LAZY)
    @ApiModelProperty(value = "商品")
    @JoinColumn(name = "commodityId")
    private Commodity commodity;

    @ApiModelProperty(value = "中文难度")
    private String hardZh;

    @ApiModelProperty(value = "学科")
    private String subjectZh;
}
